package com.atlzk.group.tgou.service.impl;

import com.atlzk.group.tgou.dao.MiaoShopDao;
import com.atlzk.group.tgou.entity.MiaoShopEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atlzk.common.utils.PageUtils;
import com.atlzk.common.utils.Query;

import com.atlzk.group.tgou.dao.MiaoDateDao;
import com.atlzk.group.tgou.entity.MiaoDateEntity;
import com.atlzk.group.tgou.service.MiaoDateService;


@Service("miaoDateService")
public class MiaoDateServiceImpl extends ServiceImpl<MiaoDateDao, MiaoDateEntity> implements MiaoDateService {

    @Autowired
    private MiaoShopDao miaoShopDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MiaoDateEntity> page = this.page(
                new Query<MiaoDateEntity>().getPage(params),
                new QueryWrapper<MiaoDateEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List <MiaoShopEntity> byMdate(Long smsMdateId) {
        List <MiaoShopEntity> list = miaoShopDao.selectList(new QueryWrapper <MiaoShopEntity>().eq("sms_mdate_id", smsMdateId));
        return list;
    }
}